//
//  ALGRootViewController.m
//  ALemonGym
//
//  Created by lanou on 16/1/8.
//  Copyright © 2016年 ALemonGym. All rights reserved.
//

#import "ALGRootViewController.h"
#import "ALGReservationMainViewController.h"
#import "ALGVideoMainViewController.h"
#import "ALGNewsMainViewController.h"
#import "ALGMineMainViewController.h"
@interface ALGRootViewController ()

@end

@implementation ALGRootViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.view.backgroundColor = [UIColor whiteColor];
    [self addViewControllerClass:[ALGReservationMainViewController class] title:@"预定" imageName:nil];
    [self addViewControllerClass:[ALGVideoMainViewController class] title:@"视频" imageName:nil];
    [self addViewControllerClass:[ALGNewsMainViewController class] title:@"资讯" imageName:nil];
    [self addViewControllerClass:[ALGMineMainViewController class] title:@"我" imageName:nil];
}


- (void)addViewControllerClass:(Class)class title:(NSString *)title imageName:(NSString *)imageName
{
    UIViewController *viewC = [[class alloc]init];
    UINavigationController *navC = [[UINavigationController alloc] initWithRootViewController:viewC];
    navC.tabBarItem.title = title;
    navC.tabBarItem.image = [UIImage imageNamed:imageName];
    [self addChildViewController:navC];
}
- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
